/// <reference types = "../bin/RayTracing" />

namespace Demo {
    export interface IDemo {
        Init(app: RAYTRACING.Application);
    }

    export class Tools {
        public static MakeModel(meshType: RAYTRACING.DefMeshType, aibedoColor: RAYTRACING.Color, pos: RAYTRACING.Vector3, euler: RAYTRACING.Vector3 = new RAYTRACING.Vector3(), scale: number = 1): RAYTRACING.Node {
            let node = new RAYTRACING.Node();
            node.mesh = RAYTRACING.DefRes.GetMesh(meshType);
            node.material = new RAYTRACING.Material();                             //mat
            node.material.aibedoColor = aibedoColor;
            //变换
            RAYTRACING.Quaternion.SetByEuler(euler.x, euler.y, euler.z, node.rotation);
            //缩放
            node.scale.set(scale, scale, scale);
            //位置
            node.position.copy(pos);
            return node;
        }
    }
}